<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%-- JSTL表达式（判断，循环，输出） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%-- 方法表达式（字符串截取，替换） --%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <link rel="stylesheet" href="<%=basePath%>css/amazeui.min.css">
    <link rel="stylesheet" href="<%=basePath%>css/wap.css">
    <link rel="stylesheet" href="<%=basePath%>css/my.css">
    <title>活动页</title>
    <style>
        .text_form{height: 0.84rem; background-color: #f5f5f5; border-radius: 0.4rem; padding-left:0.3rem; margin-top: 0.3rem}
        .text_form .content{width: 6rem;height: 0.62rem; margin-top: 0.1rem; line-height:0.62rem;background-color: #f5f5f5; font-size: 0.32rem; color: #555; border:none;}
    </style>
</head>
<body style="background:#ececec">
<div class="pet_mian" >
    <div class="pet_head">
        <header data-am-widget="header"
                class="am-header am-header-default pet_head_block">
            <div class="am-header-left am-header-nav ">
                <a href="javascript:;" class="iconfont pet_head_jt_ico" onclick="<c:if test="${returnUrl!=null}">window.history.go(-1);</c:if><c:if test="${returnUrl==null}">window.location.href='<%=basePath%>activity/getActivityIndex'</c:if>">&#xe601;</a>
            </div>
            <div class="pet_news_list_tag_name">活动详情</div>
            <%--<div class="am-header-right am-header-nav">
              <a href="javascript:;" class="iconfont pet_head_gd_ico">&#xe600;</a>
            </div>--%>
        </header>
    </div>

<div class="pet_content">
<div class="pet_content_block pet_hd_con">
<div class="pet_hd_con_head"><img class="wh_" src="${activityInfo.activityPic}" alt=""></div>
  <article data-am-widget="paragraph" class="am-paragraph am-paragraph-default pet_content_article" data-am-paragraph="{ tableScrollable: true, pureview: true }">
  <h1 class="pet_article_title" style="width: 60%; float: left;">${activityInfo.activityName}</h1>
  <div style="float: right;" onclick="collector()"><i class="icon i-colle <c:if test="${collector!=null}">active</c:if>"></i>收藏</div>
  <div style="clear: both;"></div>
  <div class="pet_article_user_time pet_hd_con_time" style="float: left;color: red; font-size: 2rem; font-weight: bold;">￥ ${activityInfo.activityPrice}</div>
  <div style="float: right;"><input style="height: 30px;" class="pet_hd_con_gp_list_xl_m" type="button" value="立即购买" onclick="window.location.href='<%=basePath%>order/toOrder?activityId=${activityInfo.activityId}'" /></div>
  <div class="pet_article_user_time pet_hd_con_map" style="visibility: hidden;clear: both;font-size: 1.7rem; border-top: 1px solid #f1f1f1; padding: 1.3rem 0px;" onclick="window.location.href='<%=basePath%>activitys_comment.jsp?activityId=${activityInfo.activityId}'">${commentCount} 条评论<span class="am-fr am-icon-chevron-right"></span></div>

  <div class="pet_hd_con_gp_list_nr" style="padding-top: 0;">
    <div class="line"></div>
    <div class="pet_hd_con_gp_list_nr_tag">关于活动</div>
    <p>
        ${activityInfo.activityBody}
    </p>

    <div class="line"></div>
    <div style="clear: both;"></div>
    <div class="pet_hd_con_gp_list_nr_tag">参加须知</div>
    <p>
        ${activityInfo.activityNotice}
    </p>

    <div class="line"></div>
    <div class="pet_hd_con_gp_list_nr_tag">活动地址</div>
    <p>
        ${activityInfo.activityAddress}
    </p>

      <div class="line"></div>
      <div class="pet_hd_con_gp_list_nr_tag">评论</div>
      <div class="pet_article_user_time pet_hd_con_map" style="clear: both;font-size: 1.7rem;  padding: 1.3rem 0px;" onclick="window.location.href='<%=basePath%>activitys_comment.jsp?activityId=${activityInfo.activityId}'">${commentCount} 条评论<span class="am-fr am-icon-chevron-right"></span></div>

      <div style="height: 2px;"></div>
  </div>

  </article>

</div>

    <div class="pet_content_main" style="margin-top: 10px;">
        <div data-am-widget="list_news" class="am-list-news am-list-news-default" >
            <div class="am-list-news-bd">
                <ul class="am-list" id="randActivity">

                </ul>
            </div>
        </div>
    </div>

</div></div>
<script src="<%=basePath%>js/jquery.min.js"></script>
<script src="<%=basePath%>js/amazeui.min.js"></script>
<script src="<%=basePath%>js/height.js"></script>
<script>
$(function(){

    // 动态计算新闻列表文字样式
    auto_resize();
    $(window).resize(function() {
        auto_resize();
    });
    $('.am-list-thumb img').load(function(){
        auto_resize();
    });
    $('.pet_article_like li:last-child').css('border','none');
        function auto_resize(){
            window.setTimeout(function () {
                $('.pet_list_one_nr').height($('.pet_list_one_img').height());
            },200);
    }
        $('.pet_article_user').on('click',function(){
            if($('.pet_article_user_info_tab').hasClass('pet_article_user_info_tab_show')){
                $('.pet_article_user_info_tab').removeClass('pet_article_user_info_tab_show').addClass('pet_article_user_info_tab_cloes');
            }else{
                $('.pet_article_user_info_tab').removeClass('pet_article_user_info_tab_cloes').addClass('pet_article_user_info_tab_show');
            }
        });

        $('.pet_head_gd_ico').on('click',function(){
            $('.pet_more_list').addClass('pet_more_list_show');
       });
        $('.pet_more_close').on('click',function(){
            $('.pet_more_list').removeClass('pet_more_list_show');
        });
});
    randActivity();

    function randActivity(){
        $.ajaxSetup({
            async : false
        });
        $.post("<%=basePath%>activity/getRandActivitys", {}, function(data){
            $("#randActivity").html(data);
        })
    }

    function collector(){
        $.post("<%=basePath%>user/newCollector", {serviceType: 1, serviceId: ${activityInfo.activityId}}, function (res) {
            if(res.code == 1){
                window.location.reload();
            }
        });
    }
</script>
</body>
</html>